import os

def checker():
    with open("candidates_list","r+") as f:
        return [[int(d) for d in x.split(" ")] for x in [z for z in f.read().split("\n") if len(z) > 0]]

target = input("please enter two natural numbers (n,m):\n")
targets = target.split(" ")
prev_list = checker()
prev_max_user = max([x[0] for x in prev_list])
assert len(targets) == 2
target_a, target_b = int(targets[0]), int(targets[1])
assert target_a>=0 and target_b >=0
assert target_b <=5
assert target_a <= 1+prev_max_user
assert [target_a,target_b] not in prev_list 
tmpscript="tmpscript.sh"
cmd = "echo {} {} >> candidates_list\npython3 -c \"import os; os.remove('tmpscript.sh')\"".format(target_a, target_b)
with open(tmpscript,"w+") as f:
    f.write(cmd)
os.system("bash {}".format(tmpscript))

print("targets",tuple(targets),"added.")
